#include <iostream>
#include <cmath>
using namespace std;
int main ()
{
    double K,N;
    cout<<"Vvedite chislo"<<endl;
    cin>>N;
    cout<<"vvedite stepen"<<endl;
    cin>>K;
    int s=0;
    for (int i=1; i<N+1; i++)
    {
        s=s+pow(i,K);
    }
    cout<<s;
    return 0;
}
